<template>
  <div class="app-container">
    <el-table
      :data="groups"
      size="mini"
      border
      stripe
      row-key="path"
      :tree-props="{'children':'children'}"
      highlight-current-row
    >
      <el-table-column type="index" width="55" />
      <el-table-column
        type="selection"
        width="55"
      />

      <el-table-column
        prop="name"
        label="分组名称"
      />
      <el-table-column
        prop="path"
        label="分组路径"
      />
    </el-table>
  </div>
</template>

<script>
import security from '@/api/security'

export default {
  name: 'group',
  data() {
    return {
      groups: []
    }
  },
  mounted() {
    this.loadGroups()
  },
  methods: {
    loadGroups() {
      security.accessGroups().then(res => {
        this.groups = [res.data]
      })
    }
  }
}
</script>


